package com.hxy.tlias.controller;

import com.hxy.tlias.pojo.PageBean;
import com.hxy.tlias.pojo.Result;
import com.hxy.tlias.service.OperateLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OperateLogController {
    private static final Logger log = LoggerFactory.getLogger(OperateLogController.class);
    @Autowired
    private OperateLogService operateLogService;

    public OperateLogController() {
    }

    @GetMapping({"/log/page"})
    public Result logPage(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer pageSize) {
        log.info("日志列表查询：{}, {}", page, pageSize);
        PageBean pageBean = this.operateLogService.logPage(page, pageSize);
        return Result.success(pageBean);
    }
}